<?php /* Smarty version 2.6.13, created on 2013-10-06 14:18:43
         compiled from Index/fooddetail.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date', 'Index/fooddetail.html', 88, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Coming Eating</title>
<link rel="shortcut icon" href="Tpl/hotel.ico"/>
<!-- href属性中的路径要相对主文件定位，否则会加载不到 -->
<link rel="stylesheet" type="text/css" href="Public/Css/Base.css"/>
<link rel="stylesheet" type="text/css" href="Public/Css/fooddetail.css"/>
<link rel="stylesheet" type="text/css" href="Public/Css/position.css"/>
<link rel="stylesheet" type="text/css" href="Public/Css/nav.css"/>

<script type="text/javascript" src="Public/Js/jquery.js"></script>
<script type="text/javascript" src="Public/Js/main.js"></script>
<script type="text/javascript" src="Public/Js/lightbox.min.js"></script>
<script type="text/javascript">
		$(document).ready(function() {
			$('#main_nav').allenMenu();
			$('#slide').allenSlide();
			$('a[name=need_lightbox]').lightBox();
		});
		
		function buyRightNow(){
			//先得到表单
			var form = $("[name='readytobuy']");
			//再将表单的action设置成所需要的地址
			form.attr('action','ShoppingCar.php?flag=display');			
			form.submit();
			
		}
		function addTocar(){
			//先得到表单
			var form = $("[name='readytobuy']");
			//再将表单的action设置成所需要的地址
			form.attr('action','AddToCar.php?flag=addtocar');			
			form.submit();					
		}
		
		function checkFoodNum(){
			var Reg = /^[1-9]{1}[0-9]*$/;
			var numValue = $("[name='food_num']").val();

			if(!Reg.test(numValue)){
				
				alert("请正确填写购买数量！");
				
			}
			
		}

</script>

</head>
<body >

<!-- 这个地方用一个标志  确定是否显示这个 -->
<?php if ($_SESSION['loginFlag'] == 0): ?>
	
	<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/hide.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php endif; ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/indexheader.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/search.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/position.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div id="fooddetail">
		<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/hotsort.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	<div id="detailright">
				<h2>商品详情</h2>
		<div id='goodspic'>
			<img src="Admin/Upload/<?php echo $this->_tpl_vars['eachFoodRes']['food_pic']; ?>
" />
			<?php if ($this->_tpl_vars['eachFoodRes']['food_state'] == 1): ?>
				<img src='Public/Images/hothot.gif' id="hothot"/>
			<?php endif; ?>
		</div>
		<div id='goodsinfo'>
			<form  action='' method="post" name="readytobuy">
			
				<table>
					<tr><td>商品名称：</td><td><?php echo $this->_tpl_vars['eachFoodRes']['food_name']; ?>
</td></tr>
					<tr><td>商品价格：</td><td><?php echo $this->_tpl_vars['eachFoodRes']['food_singleprice']; ?>
元</td></tr>
					<tr><td>会员价格：</td><td><font style="color:red;text-decoration:line-through;"><?php echo $this->_tpl_vars['eachFoodRes']['food_singleprice']; ?>
元</font>-&gt;<?php echo $this->_tpl_vars['eachFoodRes']['food_userprice']; ?>
元</td></tr>
					<tr><td>点&nbsp;击&nbsp;率：</td><td><?php echo $this->_tpl_vars['eachFoodRes']['food_count']; ?>
次</td></tr>
					<tr><td>生产日期：</td><td><?php echo ((is_array($_tmp="Y-m-d")) ? $this->_run_mod_handler('date', true, $_tmp, $this->_tpl_vars['eachFoodRes']['food_producttime']) : date($_tmp, $this->_tpl_vars['eachFoodRes']['food_producttime'])); ?>
</td></tr>
					<tr><td>保&nbsp;质&nbsp;期：</td><td><?php echo $this->_tpl_vars['eachFoodRes']['food_indate']; ?>
天</td></tr>
					<tr><td>购买数量：</td><td><input type='text' name="food_num" size='2' onchange='checkFoodNum();'/>个</td></tr>
					<tr><td colspan='2'><input type='hidden' name="food_id" value="<?php echo $this->_tpl_vars['eachFoodRes']['food_id']; ?>
"/></td></tr>
				</table>
				<div  id="buynowOrtocard">
										<input onclick="buyRightNow();" name='buynow' type='image' src='Public/Images/buynow.jpg'/>&nbsp;&nbsp;&nbsp;
					<input onclick='addTocar();' name='inputtocar' type='image' src='Public/Images/cardpic.jpg'/>
				</div>
			</form>
		</div>
		<div id='goodscontent'><?php echo $this->_tpl_vars['eachFoodRes']['food_content']; ?>
</div>
	</div>
	

</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'Public/footer.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>